/*
 *  Configuration.h
 *  GLRender
 *
 *  Created by Patrick zulian on 5/20/10.
 *  Copyright 2010 University  of Lugano. All rights reserved.
 *
 */


#ifndef CONFIGURATION_H
#define CONFIGURATION_H

#include <map>
#include "AbstractRenderer.h"
class Configuration {
private:
	bool debug, showCockpit;
	
	
	//for general purposes and passing values around
	std::map< const char *, double > confD;
	std::map< const char *, double > confInt;
public:
	Configuration();
	
	virtual
	~Configuration() { }
	
	static Configuration * INSTANCE;
	static Configuration * getInstance();
	
	inline
	const bool isDebugMode() const 
	{
		return debug;
	}
	
	inline
	void toggleDebugMode()
	{
		debug = !debug;
	}
	
	inline
	void toggleCockpit()
	{
		showCockpit = !showCockpit;
	}
	
	inline
	bool hasToShowCockpit() const
	{
		return showCockpit;
	}
	
	//General purpose functions
	
	inline
	void setD(const char * key, const double value)
	{
		confD[key] = value;
	}
	
	inline
	double getD(const char * key) 
	{
		return confD[key];
	}
	
	inline
	void setInt(const char * key, const int value)
	{
		confInt[key] = value;
	}
	
	inline
	int getInt(const char * key) 
	{
		return confInt[key];
	}
	
	AbstractRenderer * renderer;
};


#endif

